package com.leet.code.simple_array;

/**
 * @description:    1470.重新排列数组
 * @author: WYG
 * @time: 2021/1/4 18:26
 */

public class Shuffle {

    public int[] shuffle(int[] nums, int n) {
        int[] res = new int[2 * n];
        int a = 0;
        for (int i = 0; i < n; i++) {
            res[a] = nums[i];
            res[a + 1] = nums[i + n];
            a = a + 2;
        }
        return res;
    }

}
